var webpack = require('webpack');
var merge = require('webpack-merge');
var common = require('./webpack.common.js');

module.exports = env => merge(common,{
    devtool: 'eval-source-map',   //eval-source-map
    devServer: {
        port: 9001,
        contentBase: "./dist",     //本地服务器加载的路径
        historyApiFallback: true,   //不跳转
        compress: true,
        // host: "0.0.0.0",
        open: false,
        hot: true,
        inline: true,     //实时刷新
        quiet: false      //清除多余日志
    },
    plugins: [
        new webpack.EnvironmentPlugin({
            NODE_ENV:env.NODE_ENV,
            VERSION: process.env.npm_package_version
        }),
        new webpack.HotModuleReplacementPlugin(),   //组件热更新
    ]
});


